#!/bin/bash

export VERSION=$1
export BUILD_NUMBER=$2

if [ -f backupManager ]; then
	rm -rf backupManager
fi
if [ -f server.py ]; then
	rm server.py
fi
if [ -f server.cfg ]; then
	rm server.cfg
fi

mkdir backupManager
wget http://anybackup.googlecode.com/svn/trunk/server.py
wget http://anybackup.googlecode.com/svn/trunk/server.cfg
wget http://anybackup.googlecode.com/svn/trunk/backupManager/__init__.py -P backupManager
wget http://anybackup.googlecode.com/svn/trunk/backupManager/enum.py -P backupManager
wget http://anybackup.googlecode.com/svn/trunk/backupManager/mixins.py -P backupManager

archs='i386 amd64'
for arch in $archs; do
	export ARCH=$arch
	make deb
done
